<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <p>我是父组件</p>
        <hr>
        <son>
            <!-- 通过slot-scope="data1"接受子组件传来的数据，data1用来盛放数据 -->
            <template slot-scope="data1">
                <h1>{{data1.info[4]}}</h1>
            </template>
        </son>
    </div>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                
            },
            methods: {
                
            },
            components: {
                'son': {
                    template: `<div>
                            <slot :info="val"></slot>
                        </div>`,
                    data(){
                        return {
                            val: [1,2,3,4,5,6]
                        }
                    }
                }
            }
        })
    </script>
</body>
</html>